#include "musicplayerengine.h"


MusicPlayerEngine::MusicPlayerEngine()
{
    p_musicController = new MusicController();
    JsonRpcTcpServer *p_server = new JsonRpcTcpServer();
    p_server->listen(5000);

    p_server->addService(p_musicController);

    QObject::connect(p_server, SIGNAL(newClient(JsonRpcSocket*)), this, SLOT(newClientUpdate(JsonRpcSocket*)));
}

MusicPlayerEngine::~MusicPlayerEngine()
{
    delete p_musicController;
}



void MusicPlayerEngine::newClientUpdate(JsonRpcSocket *socket){
    p_musicController->updateClientTimeRange();
    p_musicController->changeClientMetaData();
}
